package com.yc.snack.dao.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ReadConfig extends Properties{
	private static final ReadConfig instance = new ReadConfig();
	//构造函数私有化，是单例模型的典型特征（单例是只有一个实例）
	private ReadConfig(){
		//InputStream is = new FileInputStream("./src/db.properties") ;   //默认路径
		try(InputStream is = this.getClass().getClassLoader().getResourceAsStream("db.properties")) {
			this.load(is);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static ReadConfig getInstance() {
		
		return instance;
	}

	
}
